from typing import Optional
from datetime import datetime
from pydantic import BaseModel

class TransactionBase(BaseModel):
    Amount: float
    TransactionType: str
    WorkAreaId: int
    Memo: Optional[str] = None

    class Config:
        from_attributes = True

class TransactionCreate(TransactionBase):
    pass

class Transaction(TransactionBase):
    TransactionId: int
    Balance: float
    CreateTime: datetime
    CreatorName: str

    class Config:
        from_attributes = True 